classdef grating < stim
    properties
        sf
        tf
        or
        c
        cen
        r
    end
    methods
        function s = grating(sf,tf,or,c,cen,r,duration,type)
            if ~exist('type','var')||isempty(type)
                type = 'grating';
            end
            if ~exist('duration','var')||isempty(duration)
                duration = Inf;
            end
            s = s@stim(type,duration);
            if isnumeric(sf)
                s.sf = sf;
            else
                error('grating:wrongType','sf should be a numeric type');
            end
            
            if isnumeric(tf)
                s.tf = tf;
            else
                error('grating:wrongType','tf should be a numeric type');
            end
            
            if isnumeric(or)
                s.or = or;
            else
                error('grating:wrongType','or should be a numeric type');
            end
            
            if isnumeric(c)
                s.c = c;
            else
                error('grating:wrongType','c should be a numeric type');
            end
            
            if isnumeric(cen) && length(cen)==2
                s.cen = cen;
            else
                error('grating:wrongType','cen should be a numeric type of length 2');
            end
            
            if isnumeric(r)
                s.r = r;
            else
                error('grating:wrongType','r should be a numeric type');
            end
        end
        
        function out = getSpatFreq(s)
            out = s.sf;
        end
        
        function out = getTempFreq(s)
            out = s.tf;
        end
        
        function out = getContrast(s)
            out = s.c;
        end
        
        function out = getOrientation(s)
            out = s.or;
        end
            
            
    end
end